package com.wechat.apidoc;

import com.wechat.entity.Answer;
import com.wechat.utils.ActionResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 *
 * @author cgc
 * @date 2018/4/2
 */
@Api(description = "答题相关接口")
public interface WxAnswerInterface {

    @ApiOperation(value = "获取答题记录信息", response = Answer.class, notes = "" +
            "\"flag\":\"true 红包已领完\"\n" +
            "\"questionTotalRight\":\"问题答对几题可拿红包\"\n" +
            "\"questionUserNickname\":\"问题发起人昵称\"\n" +
            "\"questionUserAvatarUrl\":\"问题发起人头像\"\n"+
            "\"data\": {\n" +
            "    \"id\": \"问题明细记录ID\",\n" +
            "    \"questionId\": \"出题记录编号\",\n" +
            "    \"totalNumber\": \"总题目数\",\n" +
            "    \"totalRight\": \"正确的题目数\",\n" +
            "    \"amount\": \"获得红包\",\n" +
            "  };\n"
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "answerId", value = "答题记录id", paramType = "query", required = true, dataType = "int")
    })
    ActionResult answerInfo(String key ,Integer answerId);

    @ApiOperation(value = "答题首页", notes = "" +
            "\"flag\":\"0 正常返回 1 代表是自己的题目 2 代表已经回答过此问题,会返回answerId\"\n" +
            "\"data\": {\n" +
            "    \"id\": \"问题d\",\n" +
            "    \"totalRight\": \"答对几题可抢\",\n" +
            "    \"amountStatus\": \"红包状态: 0待支付 1 红包已领完 2红包未领完 3已退回\",\n" +
            "    \"totalQuestionNumber\": \"总问题数\",\n" +
            "    \"surplusNumber\": \"剩余红包数\",\n" +
            "  };\n" +
            "\"questionUser\":{\n" +
            "    \"nickname\":\"用户昵称\",\n" +
            "    \"avatarUrl\":\"用户头像\",\n" +
            "  };"
            )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "questionId", value = "题目Id", paramType = "query", required = true, dataType = "int")
    })
    ActionResult index(String key ,Integer questionId);

    @ApiImplicitParams({
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "questionId", value = "待加密题目", paramType = "query", required = true, dataType = "String")
    })
    ActionResult getQuestionCode(String key ,Integer questionId);


    @ApiOperation(value = "开始答题", notes = "" +
            "\"flag\":\"false 代表是已经红包发完或退回了\"\n" +
            "\"data\": \"回答记录的ID 通过该ID调转到答题页面\""
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "questionId", value = "题目Id", paramType = "query", required = true, dataType = "int")
    })
    ActionResult start(String key ,Integer questionId);


    @ApiOperation(value = "答题界面获取全部问题信息", notes = "" +
            "\"data\": {\n" +
            "    \"id\": \"问题明细记录ID,返回问题明细记录ID和对应答案的数组\",\n" +
            "    \"questionId\": \"出题记录编号\",\n" +
            "    \"nickname\":\"用户昵称\",\n" +
            "    \"avatarUrl\":\"用户头像\",\n" +
            "    \"question\": \"题目\",\n" +
            "    \"answersA\": \"备选答案A\",\n" +
            "    \"answersB\": \"备选答案B\",\n" +
            "    \"answersC\": \"备选答案C\",\n" +
            "    \"answersD\": \"备选答案D\",\n" +
            "  };\n"
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "answerId", value = "答题记录ID", paramType = "query", required = true, dataType = "int")
    })
    ActionResult answer(String key ,Integer answerId);

    @ApiOperation(value = "答题完毕页面获取该答题对应问题下的所有答题记录", notes = "" +
            "\"data\": {\n" +
            "    \"id\": \"问题明细记录ID,返回问题明细记录ID和对应答案的数组\",\n" +
            "    \"questionId\": \"出题记录编号\",\n" +
            "    \"totalNumber\": \"总题目数\",\n" +
            "    \"totalRight\": \"正确的题目数\",\n" +
            "    \"amount\": \"获得红包\",\n" +
            "    \"dataState\": \"状态: 0未提交, 1已提交, 2提交失败\",\n" +
            "    \"privity\": \"默契值\",\n" +
            "    \"nickname\":\"用户昵称\",\n" +
            "    \"avatarUrl\":\"用户头像\",\n" +
            "  };\n"
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "answerId", value = "答题记录ID", paramType = "query", required = true, dataType = "int")
    })
    ActionResult getOtherAnswers(String key ,Integer answerId);

    @ApiOperation(value = "答题答案提交接口", notes = "" +
            "\"answers\": 传给后台的数据例子:\"[{id:100,answer:'aaa'},{id:101,answer:'bbb'},{id:102,answer:'ccc'},{id:103,answer:'ddd'}]\""
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "answerId", value = "答题记录ID", paramType = "query", required = true, dataType = "int"),
            @ApiImplicitParam(name = "answers", value = "题目题号和答案的数组", paramType = "query", required = true, dataType = "String")
    })
    ActionResult submit(String key ,Integer answerId,String answers);


}
